#include"utility.h"
#include<iostream>
#include"io.h"

using namespace math;

Float f(const vector_type& x)
{
	Float ans;
	return x[0] * x[0] + x[1] * x[1];
}

int main()
{
	vector_type x(2, 1);
	x[0] = 1;
	x[1] = 2;
	std::cout << "hell0" << std::endl;
	output(gradient(f, x, CENTER));

	vector<vector_function> df(2);
	df[0] = [](const vector_type &x){return 4 * std::pow(x[0], 3) + 2 * x[0] * x[1] * x[1];};
	df[1] = [](const vector_type &x){return 4 * std::pow(x[1], 3) + 2 * x[1] * x[0] * x[0];};
	output(hessian(df, x, CENTER));
	
}
